home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-2 / Inter.Net 55-2.iso / Mandrake / mdkinst / usr / bin / perl-install / standalone / diskdrake < prev    next >
Encoding:
Text File  |  2000-01-12  |  2.0 KB  |  73 lines

  1. #!/usr/bin/perl
  2.  
  3. # DiskDrake
  4. # Copyright (C) 1999 MandrakeSoft (pixel@linux-mandrake.com)
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19.  
  20. # DiskDrake uses resize_fat which is a perl rewrite of the work of Andrew
  21. # Clausen (libresize).
  22. # DiskDrake is also based upon the libfdisk and the install from Red Hat Software
  23.  
  24.  
  25. use lib qw(/usr/lib/libDrakX);
  26. use common qw(:common :functional);
  27. use diskdrake;
  28. use interactive_gtk;
  29. use detect_devices;
  30. use fsedit;
  31. use fs;
  32. use log;
  33. use c;
  34.  
  35. local $_ = join '', @ARGV;
  36.  
  37. /-h/ and die "usage: XFdrake [--expert] [--testing]\n";
  38.  
  39. $::expert = /-expert/;
  40. $::testing = /-testing/;
  41. $::isStandalone = 1;
  42.  
  43. if ($>) {
  44.     $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
  45. }
  46.  
  47.  
  48. #if ($ARGV[0] eq '-l') {
  49. #    $@ and print "Error\n";
  50. #    $::expert = 1;
  51. #    print diskdrake::get_info($_, $hds->[0]) foreach fsedit::get_fstab($hds->[0]);
  52. #    exit !$@;
  53. #}
  54. my $in = interactive_gtk->new;
  55. my $hds =
  56.     catch_cdie { fsedit::hds([ detect_devices::hds() ], {}) }
  57.     sub {
  58.     my ($err) = $@ =~ /(.*) at /;
  59.     $@ =~ /overlapping/ and $in->ask_warn('', $@), return 1;
  60.     $in->ask_okcancel(_("Error"),
  61. [_("I can't read your partition table, it's too corrupted for me :(
  62. I'll try to go on blanking bad partitions"), $err]);
  63.     };
  64.  
  65. $SIG{__DIE__} = sub { chomp $_[0]; log::l("ERROR: $_[0]") };
  66. my $fstab = [ fsedit::get_fstab(@$hds) ];
  67.  
  68. fs::get_mntpoints_from_fstab($fstab);
  69. fs::check_mounted($fstab);
  70. diskdrake::main($hds, {}, $in);
  71.  
  72. $in->exit(0);
  73.